package com.yuyu.shop.infrastructure.persistence.impl;

import com.yuyu.shop.domain.user.DO.UserInfoDO;
import com.yuyu.shop.domain.user.repository.UserRepository;
import com.yuyu.shop.infrastructure.persistence.convert.UserPoConvert;
import com.yuyu.shop.infrastructure.persistence.mapper.UserMapper;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author
 * @version 1.0
 * @description: TODO
 * @date 2022/8/4 17:35
 */
@AllArgsConstructor(onConstructor = @_(@Autowired))
@Service
public class UserRepositoryImpl implements UserRepository {

    private final UserMapper userMapper;
    @Override
    public UserInfoDO getById(Long id) {
        return UserPoConvert.PO2DO(userMapper.selectById(id));
    }
}
